package edu.nf.llmtest.common.config;

import io.netty.channel.ChannelOption;
import io.netty.handler.timeout.ReadTimeoutHandler;
import io.netty.handler.timeout.WriteTimeoutHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.netty.http.client.HttpClient;
import reactor.netty.transport.ProxyProvider;

import java.time.Duration;
import java.util.concurrent.TimeUnit;

/**
 * @ Author bin
 * @ Create  2025/9/28 下午7:16
 * webClient配置类
 **/
@Configuration
public class WebClientConfig {
    @Bean
    public WebClient siliconWebClient(WebClient.Builder builder,
                                      @Value("${silicon.base-url}") String baseUrl,
                                      @Value("${silicon.api-key}") String apiKey){
        return builder
                .baseUrl(baseUrl)
                .defaultHeader("Authorization", "Bearer " + apiKey)
                .defaultHeader("Content-Type", "application/json")
                .build();
    }
}
